<?php 
$this->jQuery()->enable();
$this->headLink()->prependStylesheet('/js/jquery/css/themes/base/jquery.ui.all.css');
$this->headScript() ->appendFile('/js/jquery/jquery-ui-1.8.12.custom.min.js')
					->appendFile('/js/jquery/ui/jquery.ui.widget.js')
					->appendFile('/js/jquery/ui/jquery.ui.core.js')					
					->appendFile('/js/jquery/ui/jquery.ui.dialog.js')					
					->appendFile('/js/jquery/ui/jquery.ui.draggable.js')
					->appendFile('/js/jquery/ui/jquery.ui.position.js')
					->appendFile('/js/jquery/ui/jquery.ui.resizable.js')
					->appendFile('/js/jquery/ui/jquery.ui.mouse.js')
					->appendFile('/js/jquery/ui/jquery.ui.button.js')
					->appendFile('/js/jquery/ui/jquery.ui.datepicker.js')
					->appendFile('/js/jquery/ui/i18n/jquery.ui.datepicker-pt-BR.js')					
					->appendFile('/js/geralAjax.js')
					->appendFile('/js/generico.js');
					

$this->headScript()->appendScript("
$(document).ready(function(){
 $('#confirme').dialog({
        height: 140,
        autoOpen: false,
        modal: true,
        resizable: false});  
        $('input#Pesquisar').button();
		$('input#PesquisaAvancada').button(); 
		$('#dataenvioinicial').datepicker();
		$('#dataenviofinal').datepicker();
		$('#box-busca-avancada-campanhas').hide(); 	             
      
});");

$translator = Zend_Registry::get('translator');
?>
<div id="flash-messeger"><?php echo $this->flashMessenger(); ?></div>
<div id="mapa">Campanhas/<span>Buscar Campanha</span></div>
<form action="<?php echo $this->form->getAction();?>" method="<?php echo $this->form->getMethod(); ?>" enctype="<?php echo $this->form->getEnctype(); ?>">
<table cellspacing="0" cellpadding="0" width="700px" border="0" style="text-align: right;">
	<tr>
		<td><?php echo $this->form->texto;?></td>
		<td><?php echo $this->form->tipo;?></td>
		<td width="10px"><?php echo $this->form->Buscar;?></td>
		<td width="10px"><input onclick="javacript:$('#box-busca-avancada-campanhas').show('blind');" type="button" name="PesquisaAvancada" id="PesquisaAvancada" value="Pesquisa Avançada" title="Pesquisa Avançada" style="font-weight:bold;" /></td>
	</tr>
</table>
</form>
<div id="box-busca-avancada-campanhas">
<div id="fechar-show"><a title="Fechar" href="javascript:void();" onclick="javascript:$('#box-busca-avancada-campanhas').hide('blind',300);">x</a></div>
<form action="<?php echo $this->formAvancado->getAction();?>" method="<?php echo $this->formAvancado->getMethod(); ?>" enctype="<?php echo $this->form->getEnctype(); ?>">
<table align="right" cellspacing="1" cellpadding="0" width="520px" border="0" style="text-align: right;">
	<tr>
		<td width="60%" align="right" class="form-avancado-assunto"> Assunto:</td>
		<td width="20%" colspan="5" align="left" > <?php echo $this->formAvancado->assunto;?></td>
	</tr>
	<tr>
		<td class="dt-inicial" align="right">Data inicial:</td>
		<td width="20%"><?php echo $this->formAvancado->dataenvioinicial;?></td>
		<td class="dt-final" width="20%" align="right">Data Final:</td>
		<td width="20%"><?php echo $this->formAvancado->dataenviofinal;?></td>
		<td><?php echo $this->formAvancado->tipo;?></td>
		<td width="10px"><input type="submit" name="PesquisaAvancada" id="PesquisaAvancada" value="Pesquisar" title="Pesquisa Avançada" style="font-weight:bold;" /></td>
	</tr>
</table>
</form>
</div>
<div id="box-quantidade-busca">A pesquisa retornou aproximadamente <?php echo count($this->BuscarCampanhasPaginacao);?> resultados</div>
<div id="box-busca">
<?php 
foreach ($this->BuscarCampanhasPaginacao as $row){ ?>
<div id="box-busca-result">
<div id="busca-nome"><strong>Nome da campanha:&nbsp</strong><?php echo $row['nome']?></div>
<div id="busca-geral"><strong>Assunto:&nbsp</strong><?php echo $row['assunto']?></div>
<div id="busca-geral"><strong>Enviada:&nbsp</strong><?php $dateTime = new Zend_Date($row['dataenvio']); echo $dateTime;?></div>
</div>
<div class="box-busca-acoes">
<a title="<?php echo $translator->_('VISUALIZAR_CAMPANHA');?>" href="javascript:abrir('/default/mkt/index/c/<?php echo $row['idcampanha']; ?>');"><img border="0" src="/imagens/icons/email_open_image.png"></a> |
<a title="<?php echo $translator->_('COPIAR_CAMPANHA');?>" href="
					<?php echo $this->url(array(
						'action' => 'copiar-campanhas', 
						'controller' => 'campanha',
						'module' => 'admin', 
						'id' => $row['idcampanha']));
					?>">
<img border="0" src="/imagens/icons/paste_plain.png"></a>
</div>
<div style="border-bottom:1px solid #dedede;height:12px"></div>
<?php }

//echo $this->paginationControl($this->BuscarCampanhasPaginacao, 'Sliding', 'paginacao.phtml');
//var_dump($this->BuscarCampanhasPaginacao);
?>
<!-- 
<table>
	<tr>
		<td colspan="4"><div align="right" style="font-size: 70%;"><strong><?php echo $translator->_('LEGENDA');?>:</strong>&nbsp&nbsp<img border="0" src="/imagens/icons/chart_line.png"> <?php echo $translator->_('GRAFICO');?> | <img border="0" src="/imagens/icons/email_open_image.png"> <?php echo $translator->_('VISUALIZAR_CAMPANHA');?> | <img border="0" src="/imagens/icons/paste_plain.png"> <?php echo $translator->_('COPIAR_CAMPANHA');?></div></td>
	</tr>
</table>
 -->
</div>
